/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package bean;

import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author root
 */
@Entity
@Table(name = "product")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Product.findAll", query = "SELECT p FROM Product p"),
    @NamedQuery(name = "Product.findByProId", query = "SELECT p FROM Product p WHERE p.proId = :proId"),
    @NamedQuery(name = "Product.findByRate", query = "SELECT p FROM Product p WHERE p.rate = :rate"),
    @NamedQuery(name = "Product.findByPeriod", query = "SELECT p FROM Product p WHERE p.period = :period"),
    @NamedQuery(name = "Product.findByName", query = "SELECT p FROM Product p WHERE p.name = :name"),
    @NamedQuery(name = "Product.findBySummary", query = "SELECT p FROM Product p WHERE p.summary = :summary"),
    @NamedQuery(name = "Product.findByStartDate", query = "SELECT p FROM Product p WHERE p.startDate = :startDate"),
    @NamedQuery(name = "Product.findByMinInvestmentMoney", query = "SELECT p FROM Product p WHERE p.minInvestmentMoney = :minInvestmentMoney"),
    @NamedQuery(name = "Product.findBySubscriptionCost", query = "SELECT p FROM Product p WHERE p.subscriptionCost = :subscriptionCost"),
    @NamedQuery(name = "Product.findByRatio", query = "SELECT p FROM Product p WHERE p.ratio = :ratio"),
    @NamedQuery(name = "Product.findByProtype", query = "SELECT p FROM Product p WHERE p.protype = :protype"),
    @NamedQuery(name = "Product.findByType", query = "SELECT p FROM Product p WHERE p.type = :type")})
public class Product implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "proId")
    private Integer proId;
    @Size(max = 50)
    @Column(name = "rate")
    private String rate;
    @Size(max = 45)
    @Column(name = "period")
    private String period;
    @Size(max = 100)
    @Column(name = "name")
    private String name;
    @Size(max = 200)
    @Column(name = "summary")
    private String summary;
    @Column(name = "startDate")
    private BigInteger startDate;
    @Size(max = 45)
    @Column(name = "minInvestmentMoney")
    private String minInvestmentMoney;
    @Size(max = 45)
    @Column(name = "subscriptionCost")
    private String subscriptionCost;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "ratio")
    private Float ratio;
    @Column(name = "protype")
    private Integer protype;
    @Column(name = "type")
    private Integer type;

    public Product() {
    }

    public Product(Integer proId) {
        this.proId = proId;
    }

    public Integer getProId() {
        return proId;
    }

    public void setProId(Integer proId) {
        this.proId = proId;
    }

    public String getRate() {
        return rate;
    }

    public void setRate(String rate) {
        this.rate = rate;
    }

    public String getPeriod() {
        return period;
    }

    public void setPeriod(String period) {
        this.period = period;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public BigInteger getStartDate() {
        return startDate;
    }

    public void setStartDate(BigInteger startDate) {
        this.startDate = startDate;
    }

    public String getMinInvestmentMoney() {
        return minInvestmentMoney;
    }

    public void setMinInvestmentMoney(String minInvestmentMoney) {
        this.minInvestmentMoney = minInvestmentMoney;
    }

    public String getSubscriptionCost() {
        return subscriptionCost;
    }

    public void setSubscriptionCost(String subscriptionCost) {
        this.subscriptionCost = subscriptionCost;
    }

    public Float getRatio() {
        return ratio;
    }

    public void setRatio(Float ratio) {
        this.ratio = ratio;
    }

    public Integer getProtype() {
        return protype;
    }

    public void setProtype(Integer protype) {
        this.protype = protype;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (proId != null ? proId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Product)) {
            return false;
        }
        Product other = (Product) object;
        if ((this.proId == null && other.proId != null) || (this.proId != null && !this.proId.equals(other.proId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "bean.Product[ proId=" + proId + " ]";
    }

//    @Override
//    public String toString() {
//        return "Product{" + "proId=" + proId + ", rate=" + rate + ", period=" + period + ", name=" + name + ", summary=" + summary + ", startDate=" + startDate + ", minInvestmentMoney=" + minInvestmentMoney + ", subscriptionCost=" + subscriptionCost + ", ratio=" + ratio + ", protype=" + protype + ", type=" + type + '}';
//    }
    
    
}
